<?php
namespace Product\Model;

use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;
 
class Catalog 
{
    public $id;
    public $name;
    public $cost_code;
    public $cost_value;
    public $listprice_code;
    public $listprice_value;
    public $sellprice_code;
    public $sellprice_value;
	
	
    public function exchangeArray($data)
    {
        $this->id = (isset($data['id'])) ? $data['id'] : null;
        $this->name = (isset($data['name'])) ? $data['name'] : null;
        $this->cost_code = (isset($data['cost_code'])) ? $data['cost_code']:null;
        $this->cost_value = (isset($data['cost_value'])) ? $data['cost_value']:null;
		$this->listprice_code = (isset($data['listprice_code'])) ? $data['listprice_code']:null;
		$this->listprice_value = (isset($data['listprice_value'])) ? $data['listprice_value']:null;
        $this->sellprice_code = (isset($data['sellprice_code'])) ? $data['sellprice_code']:null;
		$this->sellprice_value = (isset($data['sellprice_value'])) ? $data['sellprice_value']:null;
		
    }
	
	public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
        
    public function getArrayCopy()
     {
         return get_object_vars($this);
     }
	 
	  public function setInputFilter(InputFilterInterface $inputFilter)
     {
         throw new \Exception("Not used");
     }

     public function getInputFilter()
     {
         if (!$this->inputFilter) {
             $inputFilter = new InputFilter();

             $inputFilter->add(array(
                 'name'     => 'id',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'Int'),
                 ),
             ));

             $inputFilter->add(array(
                 'name'     => 'name',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ),     
             ));

             $inputFilter->add(array(
                 'name'     => 'cost_code',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ),
			 ));
			 
			  $inputFilter->add(array(
                 'name'     => 'cost_value',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ),
			 ));

			 $inputFilter->add(array(
                 'name'     => 'listprice_code',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ), 
             ));
			 
			 $inputFilter->add(array(
                 'name'     => 'listprice_value',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ), 
             ));
			 
			 $inputFilter->add(array(
                 'name'     => 'sellprice_code',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ), 
             ));
			 
			 $inputFilter->add(array(
                 'name'     => 'sellprice_value',
                 'required' => true,
                 'filters'  => array(
                     array('name' => 'StripTags'),
                     array('name' => 'StringTrim'),
                 ), 
             ));
			 
             $this->inputFilter = $inputFilter;
         }

         return $this->inputFilter;
     }
 
}